#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include<vector>
using namespace std;

int main()
{
    vector<int> v;
    int n = 0;
    cin >> n;
    //v.reserve(n);
    v.push_back(1);
    for (int i = 2; i <= n; i++)
    {
        int j = 2;
        for (j = 2; j < i; j++)
        {
            if (i % j == 0)
            {
                break;
            }
        }
        if (i == j)
        {
            v.push_back(i);
        }
    }
    int i = 0, k = 0;
    for (i = 0; i < v.size(); i++)
    {
        for (k = 0; k < v.size(); k++)
        {
            if (v[i] + v[k] == n)
            {
                cout << i << endl;
                cout << k << endl;
                break;
            }
        }
        if (v[i] + v[k] == n)
            break;
    }
}